/*
 * Created on 2004-10-4
 */
package hzjbbis.framework.taglib.config;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
/**
 * @since 1.0
 * @author lix
 */
public class SimpleConfigElement implements ConfigElement {
    private final String _htmlTag;

    public SimpleConfigElement(String htmlTag) {
        _htmlTag = htmlTag;
    }
    /**
     * @see hzjbbis.framework.taglib.config.ConfigElement#htmlTagString()
     */
    public String htmlTagString() {
        return _htmlTag;
    }

    /**
     * @see java.lang.Object#equals(Object)
     */
    public boolean equals(Object object) {
        if (!(object instanceof SimpleConfigElement)) {
            return false;
        }
        SimpleConfigElement rhs = (SimpleConfigElement) object;
        return new EqualsBuilder().append(this._htmlTag, rhs._htmlTag)
                .isEquals();
    }
    /**
     * @see java.lang.Object#hashCode()
     */
    public int hashCode() {
        return new HashCodeBuilder(-825548263, 246472687).append(this._htmlTag)
                .toHashCode();
    }
    /**
     * @see java.lang.Object#toString()
     */
    public String toString() {
        return htmlTagString();
    }
}
